import Layout from '@/layout';
import SettingEnv from '@/setting.env';

const financial = 'financial_';

export default {
  path: `${SettingEnv.customRouter}/financial`,
  name: 'financial',
  component: Layout,
  redirect: `${SettingEnv.customRouter}/financial/commission/template`,
  meta: {
    title: '财务',
    icon: 'clipboard'
  },
  children: [
    {
      path: 'commission',
      component: () => import('@/views/financial/index'),
      name: `${financial}Commission`,
      meta: {
        title: '财务操作'
      },
      redirect: 'noRedirect',
      alwaysShow: true,
      children: [
        {
          path: 'template',
          component: () => import('@/views/financial/commission/withdrawal/index'),
          name: 'commissionTemplate',
          meta: { title: '提现申请', icon: '' }
        }
      ]
    },
    {
      path: 'capital',
      component: () => import('@/views/financial/index'),
      name: `${financial}capital`,
      meta: {
        title: '财务记录'
      },
      redirect: 'noRedirect',
      alwaysShow: true,
      children: [
        {
          path: 'bill',
          component: () => import('@/views/financial/capital/fundRecords/index'),
          name: 'capitalTemplate',
          meta: { title: '资金记录', icon: '' }
        }
      ]
    }
  ]
};
